#define _CRT_SECURE_NO_WARNINGS 1
#include "list.h"
using namespace std;
void ding::test_list1()
{
	list<int> lt;
	lt.push_back(1);
	lt.push_back(2);
	lt.push_back(3);
	lt.push_back(4);
	list<int> lt2(lt.begin(),lt.end());

	for (auto x : lt)
	{
		cout << x << ' ';
	}
	cout << endl;
	lt.resize(2);
	for (auto x : lt)
	{
		cout << x << ' ';
	}
	cout << endl;
	lt.resize(0);
	for (auto x : lt)
	{
		cout << x << ' ';
	}
	cout << endl;
	lt.resize(20, 666);
	for (auto x : lt)
	{
		cout << x << ' ';
	}
	cout << endl;
	lt2.swap(lt);
	cout << "lt2=";
	for (auto x : lt2)
	{
		cout << x << ' ';
	}
	cout << "lt=";
	for (auto x : lt)
	{
		cout << x << ' ';
	}
	/*for (auto x : lt)
	{
		cout << x << ' ';
	}*/
	/*cout << "szie =" << lt.size() << endl;
	lt.pop_back();
	lt.pop_front();
	for (auto x : lt)
	{
		cout << x << ' ';
	}
	cout << "szie =" << lt.size() << endl;*/

}

void ding::test_list2()
{
	list<int> lt;
	lt.push_back(1);
	lt.push_back(2);
	lt.push_back(3);
	lt.push_back(4);
	lt.push_back(5);
	for (auto x : lt)
	{
		cout << x << ' ';
	}
	cout << endl;
	list<int> lt2(lt.begin(),lt.end());
	for (auto x : lt2)
	{
		cout << x << ' ';
	}

}

int main()
{
	/*std::list<int> lt;
	lt.push_back(1);
	lt.push_back(2);
	lt.push_back(3);
	auto it = find(lt.begin(), lt.end(),3);
	lt.erase(it);
	lt.resize(10, 2);
	for (auto x : lt)
	{
		cout << x << ' ';
	}
	*/

	//ding::test_list2();
	ding::test_list1();

	return 0;
}